package com.guigu.eduservice.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guigu.eduservice.entity.EquipmentImage;
import com.guigu.eduservice.service.EquipmentImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 设备图片表（存储设备的展示图片，最多25张） 前端控制器
 * </p>
 *
 * @author janecraft
 * @since 2025-09-27
 */
@RestController
@RequestMapping("/eduservice/equipmentImage")
public class EquipmentImageController {
    @Autowired
    private EquipmentImageService equipmentImageService;

    @GetMapping("/getEqImage/{equipmentId}")
    public List<EquipmentImage> getEqImage(@PathVariable Long equipmentId) {
        QueryWrapper<EquipmentImage> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("equipment_id",equipmentId);
        List<EquipmentImage> list = equipmentImageService.list(queryWrapper);
        return list;
    }


}
